﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="FHForm.aspx.cs" Inherits="RenShiKaoQin.Account.FHForm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </ajaxToolkit:ToolkitScriptManager>
<div align="center">
<table border="2" rules="all" cellpadding="5" width="200px"><tr style="font-size:23px;font-weight:bold"><td>请&nbsp;&nbsp;假&nbsp;&nbsp;复&nbsp;&nbsp;核</td></tr></table>
输入姓名<asp:TextBox ID="tbName" runat="server" 
        Width="90px" EnableViewState="False" ViewStateMode="Disabled"></asp:TextBox>或者输入申请起始日期的时间段从<asp:TextBox
        ID="tbStart" runat="server" Width="120px" EnableViewState="False" 
        ViewStateMode="Disabled"></asp:TextBox><ajaxToolkit:CalendarExtender ID="caltbStart"
            TargetControlID="tbStart" runat="server" Format="yyyy-MM-dd" DefaultView="Months">
        </ajaxToolkit:CalendarExtender>
    至<asp:TextBox ID="tbEnd" runat="server" Width="120px" EnableViewState="False" 
        ViewStateMode="Disabled"></asp:TextBox><ajaxToolkit:CalendarExtender
        ID="CalendarExtender1" TargetControlID="tbEnd" runat="server" Format="yyyy-MM-dd"
        DefaultView="Months">
    </ajaxToolkit:CalendarExtender>
    来<asp:Button ID="btnSearch" runat="server" Text="查询" 
        onclick="btnSearch_Click" />
         <div>
    <asp:CheckBox ID="cbDisplayFH" runat="server" AutoPostBack="True" 
                 oncheckedchanged="cbDisplayFH_CheckedChanged" />显示已经复核的申请<asp:HyperLink ID="HyperLink1" runat="server" Text="数据导出" NavigateUrl="~/Account/FHExport.aspx"></asp:HyperLink>
        </div>
    <asp:GridView ID="gvFH" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="SerialNO" DataSourceID="sqlFH" 
        onrowupdating="gvFH_RowUpdating" EmptyDataText="没有符合条件的数据" CellPadding="4" 
        ForeColor="#333333" GridLines="None" AllowPaging="True" Font-Size="17px" 
        onrowcommand="gvFH_RowCommand">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="EmployeeName" HeaderText="姓名" 
                SortExpression="EmployeeName" />
            <asp:BoundField DataField="TypeName" HeaderText="请假类型" 
                SortExpression="TypeName" />
            <asp:BoundField DataField="StartDate" HeaderText="开始时间" 
                SortExpression="StartDate" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="EndDate" HeaderText="结束时间" 
                SortExpression="EndDate" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="DeptName" HeaderText="所在科室" 
                SortExpression="DeptName" />
            <asp:TemplateField HeaderText="审批状态">
                <ItemTemplate>
                <asp:Label ID="lbExamStatus" runat="server" Text='<%# Eval("ExamStatus").ToString().Equals("True")?"已审批":"未审批" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="复核状态">
                <ItemTemplate>
                    <asp:Label ID="lbCheckStatus" runat="server" Text='<%# Eval("CheckStatus").ToString().Equals("True")?"已复核":"未复核" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="拒绝状态">
                <ItemTemplate>
                    <asp:Label ID="lbRejectStatus" runat="server" Text='<%# Eval("RejectStatus").ToString().Equals("True")?"已拒绝":"未拒绝" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="阅读状态">
                <ItemTemplate>
                <asp:Label ID="lbReadStatus" runat="server" Text='<%# Eval("ReadStatus").ToString().Equals("True")?"已阅读":"未阅读" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="复核">
                <ItemTemplate>
                    <asp:LinkButton ID="lkbFH" runat="server" CommandName="Update" Visible='<%# !Convert.ToBoolean(Eval("CheckStatus")) %>' Text="通过"></asp:LinkButton>
                    <asp:LinkButton ID="lkbDispReason" runat="server" CommandName="DispReason" Visible='<%# Eval("CheckStatus").ToString().Equals("False") %>' Text="拒绝" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'></asp:LinkButton><asp:LinkButton ID="lkbUpdate" runat="server" Visible="false" Text="确定" CommandName="UpdateReason" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'></asp:LinkButton><br />
                    <asp:TextBox ID="tbReason" runat="server" Visible="false" Width="72px"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="sqlFH" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
        
        
        SelectCommand="SELECT TKQRequestRecord.FEmployeeID, TKQRequestRecord.StartDate, TKQRequestRecord.EndDate, TKQRequestRecord.TypeCode, TKQRequestRecord.Memo, TKQRequestRecord.ExamStatus, TKQRequestRecord.CheckStatus, TKQRequestRecord.SerialNO, TKQRequestRecord.ReadStatus, TKQRequestRecord.RejectStatus, TKQRequestRecord.DeptCode, TEmployee.FName AS EmployeeName, TDictDept.FName AS DeptName, TDictKQType.FName AS TypeName FROM TKQRequestRecord INNER JOIN TEmployee ON TKQRequestRecord.FEmployeeID = TEmployee.FEmployeeID INNER JOIN TDictDept ON TKQRequestRecord.DeptCode = TDictDept.FDeptCode INNER JOIN TDictKQType ON TKQRequestRecord.TypeCode = TDictKQType.FKQTypeCode WHERE (TKQRequestRecord.CheckStatus = @CheckStatus) AND (TKQRequestRecord.ExamStatus = 1) AND (TKQRequestRecord.TypeCode &lt; '11') AND (TEmployee.FName = @EmployeeName) AND (TKQRequestRecord.RejectStatus = 0) OR (TKQRequestRecord.CheckStatus = @CheckStatus) AND (TKQRequestRecord.ExamStatus = 1) AND (TKQRequestRecord.TypeCode = '60') AND (TEmployee.FName = @EmployeeName) AND (TKQRequestRecord.RejectStatus = 0) OR (TKQRequestRecord.CheckStatus = @CheckStatus) AND (TKQRequestRecord.ExamStatus = 1) AND (TKQRequestRecord.TypeCode &lt; '11') AND (TKQRequestRecord.RejectStatus = 0) AND (TKQRequestRecord.StartDate &gt;= @StartDate) AND (TKQRequestRecord.StartDate &lt;= @EndDate) OR (TKQRequestRecord.CheckStatus = @CheckStatus) AND (TKQRequestRecord.ExamStatus = 1) AND (TKQRequestRecord.TypeCode = '60') AND (TKQRequestRecord.RejectStatus = 0) AND (TKQRequestRecord.StartDate &gt;= @StartDate) AND (TKQRequestRecord.StartDate &lt;= @EndDate) ORDER BY TKQRequestRecord.StartDate, EmployeeName, DeptName" 
        
        
        
        
        
        
        
        
        UpdateCommand="UPDATE TKQRequestRecord SET CheckStatus = @CheckStatus, CheckerID = @CheckerID, CheckDate = @CheckDate WHERE (SerialNO = @SerialNO)">
        <SelectParameters>
            <asp:ControlParameter ControlID="cbDisplayFH" Name="CheckStatus" 
                PropertyName="Checked" />
            <asp:Parameter Name="EmployeeName" />
            <asp:Parameter Name="StartDate" />
            <asp:Parameter Name="EndDate" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="CheckStatus" />
            <asp:Parameter Name="CheckerID" />
            <asp:Parameter Name="CheckDate" />
            <asp:Parameter Name="SerialNO" />
        </UpdateParameters>
    </asp:SqlDataSource>
</div>
</asp:Content>
